(() => {
    console.log('hello world aaaaa');
    // 数组
    let arr1 = [1, 3, 4, 5];
    let arr2 = ['a', 'b'];
    let arr3 = [123, 344, 555];
    arr3.push(456);
    for (const key in arr3) {
        if (Object.prototype.hasOwnProperty.call(arr3, key)) {
            const element = arr3[key];
            console.log(element);
        }
    }
    // 元祖
    let tu1 = ['yejing', 35, true];
    console.log(tu1);
    console.log(tu1[0]);
    console.log(tu1[1]);
    console.log(tu1[2]);
    // 枚举
    let Color;
    (function (Color) {
        Color[Color["red"] = 10] = "red";
        Color[Color["yellow"] = 100] = "yellow";
        Color[Color["blue"] = 1000] = "blue";
        Color[Color["green"] = 10000] = "green";
    })(Color || (Color = {}));
    console.log(Color.red);
    console.log(Color.yellow);
    console.log(Color.blue);
    console.log(Color.green);
    console.log(Color[100]);
    // 字符串
    let name = 'yejing';
    let wel = `hello ${name}`;
    console.log(123, wel);
    // any 类型，就是不知道是什么类型，什么值都可以
    let a1 = 'hello world';
    console.log(a1);
    a1 = 4;
    console.log(a1);
    // unknown 类型，也是不知道是什么类型，什么值都可以
    let b1 = 10;
    console.log(111, b1);
    b1 = 'hello world';
    console.log(111, b1);
    function showMsg() {
        console.log("hello world");
    }
    function foo() {
        return '年少不知富婆好，错把少妇当个宝';
    }
    console.log(foo());
    // 对象类型
    function getObject(obj) {
        console.log(obj);
        return {
            name: '卡卡西',
            age: 27
        };
    }
    console.log(getObject({ name: 'aaa', age: 45 }));
    // 类型断言
    function getString(str) {
        // (<string>str)
        if (str.length) {
            return str.length;
        }
        else {
            return str.toString().length;
        }
    }
    console.log(getString('abc'));
    console.log(getString(12345));
    // 解构
    let input = ['hello', 34];
    function test(input) {
        let [a, b] = input;
        console.log(1234, a);
        console.log(1234, b);
    }
    test(input);
})();
